package validation

import (
	"github.com/go-playground/validator/v10"
)

func validUser(fl validator.FieldLevel) bool {
	return fl.Field().String() == "admin"
}

//自定义验证器
//https://github.com/go-playground/validator/blob/v9/_examples/translations/main.go
/*
	v.RegisterTranslation("is-validuser", trans, func(ut ut.Translator) error {
		return ut.Add("is-validuser", "{0} 填写不正确哦", true)
	}, func(ut ut.Translator, fe validator.FieldError) string {
		t, _ := ut.T("is-validuser", fe.Field())
		return t
	})
*/
